package com.wicket.okrrbff.web.contorller;

import cn.hutool.core.bean.BeanUtil;
import com.wicket.okrrbff.biz.service.AlbumService;
import com.wicket.okrrbff.biz.service.dto.req.*;
import com.wicket.okrrbff.biz.service.dto.res.*;
import com.wicket.okrrbff.common.ro.OkrResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.wicket.okrdataassets.integration.FwDataassetsAlbumClient;
import com.wicket.okrdataassets.integration.dto.QueryAlbumDetailComRespDto;
import com.wicket.okrdataassets.integration.dto.QueryAlbumDetailComReqDto;
import com.wicket.okrrbff.common.exception.Assert;
import com.wicket.okrdataassets.integration.dto.AddAlbumComRespDto;
import com.wicket.okrdataassets.integration.dto.AddAlbumComReqDto;
import com.wicket.okrdataassets.integration.dto.UpdateAlbumComRespDto;
import com.wicket.okrdataassets.integration.dto.UpdateAlbumComReqDto;
import com.wicket.okrdataassets.integration.FwDataassetsUnstructuredResourcesClient;
import com.wicket.okrdataassets.integration.dto.ImplementSubjectLifeCycleJudgeComRespDto;
import com.wicket.okrdataassets.integration.dto.ImplementSubjectLifeCycleJudgeComReqDto;
import com.wicket.okrdataassets.integration.dto.DeleteAlbumComRespDto;
import com.wicket.okrdataassets.integration.dto.DeleteAlbumComReqDto;
import com.wicket.okrdataassets.integration.dto.AddAlbumShareRecRespDto;
import com.wicket.okrdataassets.integration.dto.AddAlbumShareRecReqDto;
import com.wicket.okrdataassets.integration.dto.QueryPersonOrDeptAlbumListRespDto;
import com.wicket.okrdataassets.integration.dto.QueryPersonOrDeptAlbumListReqDto;
import com.wicket.okrdataassets.integration.dto.BatchQueryPersonOrDeptNameRespDto;
import com.wicket.okrdataassets.integration.dto.BatchQueryPersonOrDeptNameReqDto;
import java.util.stream.Collectors;
import cn.hutool.core.collection.CollectionUtil;
import com.wicket.okrdataassets.integration.dto.UpdateAlbumFileRelationComRespDto;
import com.wicket.okrdataassets.integration.dto.UpdateAlbumFileRelationComReqDto;
import com.wicket.okrdataassets.integration.dto.QueryAlbumFileRelationDetailComRespDto;
import com.wicket.okrdataassets.integration.dto.QueryAlbumFileRelationDetailComReqDto;
import com.wicket.okrdataassets.integration.dto.QueryAlbumFileRelationListComRespDto;
import com.wicket.okrdataassets.integration.dto.QueryAlbumFileRelationListComReqDto;
import com.wicket.okrrbff.biz.service.dto.common.BffAlbumFileRelationDto;
import com.wicket.okrdataassets.integration.dto.UpdateAlbumArchiveRespDto;
import com.wicket.okrdataassets.integration.dto.UpdateAlbumArchiveReqDto;
import com.wicket.okrdataassets.integration.dto.QueryRecycleListRespDto;
import com.wicket.okrdataassets.integration.dto.QueryRecycleListReqDto;
import com.wicket.okrrbff.biz.service.dto.common.BffRecycleDto;
import com.wicket.okrdataassets.integration.dto.RemoveFileOfAlbumRespDto;
import com.wicket.okrdataassets.integration.dto.RemoveFileOfAlbumReqDto;
import com.wicket.okrdataassets.integration.dto.DeleteFileOfAlbumComRespDto;
import com.wicket.okrdataassets.integration.dto.DeleteFileOfAlbumComReqDto;
import com.wicket.okrdataassets.integration.dto.BatchDeleteFileOfAlbumRespDto;
import com.wicket.okrdataassets.integration.dto.BatchDeleteFileOfAlbumReqDto;
import com.wicket.okrdataassets.integration.dto.AlbumFileRelationDto;
import com.wicket.okrdataassets.integration.dto.CopyAlbumRespDto;
import com.wicket.okrdataassets.integration.dto.CopyAlbumReqDto;
import com.wicket.okrdataassets.integration.dto.QueryDuplicateAlbumNameDetailComRespDto;
import com.wicket.okrdataassets.integration.dto.QueryDuplicateAlbumNameDetailComReqDto;
import com.wicket.okrrbff.common.exception.BizException;
import com.wicket.okrrbff.biz.service.dto.common.BffAlbumDto;
import com.wicket.okrdataassets.integration.dto.LoopAddAlbumFileRelationRespDto;
import com.wicket.okrdataassets.integration.dto.LoopAddAlbumFileRelationReqDto;
import com.wicket.okrdataassets.integration.dto.ResourceFileDto;
import com.wicket.okrrbff.common.util.CommonFunctionHelper;
import com.wicket.okrdataassets.integration.FwDataassetsResourceFileClient;
import com.wicket.okrdataassets.integration.dto.QueryResourceFileDetailComRespDto;
import com.wicket.okrdataassets.integration.dto.QueryResourceFileDetailComReqDto;
import com.wicket.okrdataassets.integration.dto.MoveFilesToSpecAlbumRespDto;
import com.wicket.okrdataassets.integration.dto.MoveFilesToSpecAlbumReqDto;
import com.wicket.okrdataassets.integration.dto.CopyFilesToSpecAlbumRespDto;
import com.wicket.okrdataassets.integration.dto.CopyFilesToSpecAlbumReqDto;
import com.wicket.okrdataassets.integration.dto.UpdateAlbumFilesRelationComRespDto;
import com.wicket.okrdataassets.integration.dto.UpdateAlbumFilesRelationComReqDto;
import com.wicket.okrdataassets.integration.dto.BatchArchiveAlbumFileRelationRespDto;
import com.wicket.okrdataassets.integration.dto.BatchArchiveAlbumFileRelationReqDto;
import com.wicket.okrdataassets.integration.dto.QueryFileOfAlbumDetailComRespDto;
import com.wicket.okrdataassets.integration.dto.QueryFileOfAlbumDetailComReqDto;
import com.wicket.okrdataassets.integration.dto.RemoveFileOfAlbumComRespDto;
import com.wicket.okrdataassets.integration.dto.RemoveFileOfAlbumComReqDto;
import com.wicket.okrdataassets.integration.dto.QueryResourceFileListComRespDto;
import com.wicket.okrdataassets.integration.dto.QueryResourceFileListComReqDto;
import com.wicket.okrdataassets.integration.dto.ImplementRecycleComRespDto;
import com.wicket.okrdataassets.integration.dto.ImplementRecycleComReqDto;
import com.wicket.okrdataassets.integration.dto.AnalysisResourceFileObjectNameComRespDto;
import com.wicket.okrdataassets.integration.dto.AnalysisResourceFileObjectNameComReqDto;

/**
 * @author ：
 * @date ：
 *
 *
 * @version 1.0
 */
@Api(value = "Album", tags = { "Album" })
@RestController
// @RequestMapping("/rbff/album/")
public class AlbumController {

  @Autowired
  AlbumService albumService;
/**
   * B8查询专辑详情
   * gen by moon at 11/13/2024, 8:51:07 PM
   */
    @PostMapping("/oms/dataassets/album/queryAlbumDetail")
    @ApiOperation(value = "B8查询专辑详情", response = OkrResult.class)
    public OkrResult<BffQueryAlbumDetailRespDto> queryAlbumDetail(@RequestBody(required=false) @Validated BffQueryAlbumDetailReqDto reqDTO){
        return OkrResult.success(albumService.queryAlbumDetail(reqDTO));
    }
/**
   * B8新增专辑
   * gen by moon at 11/13/2024, 9:11:48 PM
   */
    @PostMapping("/oms/dataassets/album/addAlbum")
    @ApiOperation(value = "B8新增专辑", response = OkrResult.class)
    public OkrResult<BffAddAlbumRespDto> addAlbum(@RequestBody(required=false) @Validated BffAddAlbumReqDto reqDTO){
        return OkrResult.success(albumService.addAlbum(reqDTO));
    }
/**
   * B8修改专辑
   * gen by moon at 11/14/2024, 1:20:03 PM
   */
    @PostMapping("/oms/dataassets/album/updateAlbum")
    @ApiOperation(value = "B8修改专辑", response = OkrResult.class)
    public OkrResult<BffUpdateAlbumRespDto> updateAlbum(@RequestBody(required=false) @Validated BffUpdateAlbumReqDto reqDTO){
        return OkrResult.success(albumService.updateAlbum(reqDTO));
    }
/**
   * B8删除专辑
   * gen by moon at 11/14/2024, 1:20:05 PM
   */
    @PostMapping("/oms/dataassets/album/deleteAlbum")
    @ApiOperation(value = "B8删除专辑", response = OkrResult.class)
    public OkrResult<BffDeleteAlbumRespDto> deleteAlbum(@RequestBody(required=false) @Validated BffDeleteAlbumReqDto reqDTO){
        return OkrResult.success(albumService.deleteAlbum(reqDTO));
    }
/**
   * B8新增专辑分享记录表
   * gen by moon at 11/14/2024, 1:20:07 PM
   */
    @PostMapping("/oms/dataassets/album/addAlbumShareRec")
    @ApiOperation(value = "B8新增专辑分享记录表", response = OkrResult.class)
    public OkrResult<BffAddAlbumShareRecRespDto> addAlbumShareRec(@RequestBody(required=false) @Validated BffAddAlbumShareRecReqDto reqDTO){
        return OkrResult.success(albumService.addAlbumShareRec(reqDTO));
    }
/**
   * B8查询专辑列表
   * gen by moon at 11/14/2024, 1:20:10 PM
   */
    @PostMapping("/oms/dataassets/album/queryAlbumList")
    @ApiOperation(value = "B8查询专辑列表", response = OkrResult.class)
    public OkrResult<BffQueryAlbumListRespDto> queryAlbumList(@RequestBody(required=false) @Validated BffQueryAlbumListReqDto reqDTO){
        return OkrResult.success(albumService.queryAlbumList(reqDTO));
    }
/**
   * B8修改专辑文件别名
   * gen by moon at 11/14/2024, 1:20:12 PM
   */
    @PostMapping("/oms/dataassets/album/updateAlbumFileRelation")
    @ApiOperation(value = "B8修改专辑文件别名", response = OkrResult.class)
    public OkrResult<BffUpdateAlbumFileRelationRespDto> updateAlbumFileRelation(@RequestBody(required=false) @Validated BffUpdateAlbumFileRelationReqDto reqDTO){
        return OkrResult.success(albumService.updateAlbumFileRelation(reqDTO));
    }
/**
   * B8查询专辑文件关系详情
   * gen by moon at 11/14/2024, 1:20:14 PM
   */
    @PostMapping("/oms/dataassets/album/queryAlbumFileRelationDetail")
    @ApiOperation(value = "B8查询专辑文件关系详情", response = OkrResult.class)
    public OkrResult<BffQueryAlbumFileRelationDetailRespDto> queryAlbumFileRelationDetail(@RequestBody(required=false) @Validated BffQueryAlbumFileRelationDetailReqDto reqDTO){
        return OkrResult.success(albumService.queryAlbumFileRelationDetail(reqDTO));
    }

//    /**
//     * B8新增文件关系
//     * gen by moon at 11/14/2024, 1:20:14 PM
//     */
//    @PostMapping("/oms/dataassets/album/loopAddAlbumFileRelation")
//    @ApiOperation(value = "B8新增文件关系", response = OkrResult.class)
//    public OkrResult<BffQueryAlbumFileRelationDetailRespDto> queryAlbumFileRelationDetail(@RequestBody(required=false) @Validated Map<String,Object> reqDTO){
//        albumService.addFileRelation(reqDTO);
//        return OkrResult.success(new BffQueryAlbumFileRelationDetailRespDto());
//    }
/**
   * B8查询专辑文件关系列表
   * gen by moon at 11/14/2024, 1:20:16 PM
   */
    @PostMapping("/oms/dataassets/album/queryAlbumFileRelationList")
    @ApiOperation(value = "B8查询专辑文件关系列表", response = OkrResult.class)
    public OkrResult<BffQueryAlbumFileRelationListRespDto> queryAlbumFileRelationList(@RequestBody(required=false) @Validated BffQueryAlbumFileRelationListReqDto reqDTO){
        return OkrResult.success(albumService.queryAlbumFileRelationList(reqDTO));
    }

/**
   * B8查询回收站列表
   * gen by moon at 11/14/2024, 1:20:27 PM
   */
    @PostMapping("/oms/dataassets/album/queryRecycleList")
    @ApiOperation(value = "B8查询回收站列表", response = OkrResult.class)
    public OkrResult<BffQueryRecycleListRespDto> queryRecycleList(@RequestBody(required=false) @Validated BffQueryRecycleListReqDto reqDTO){
        return OkrResult.success(albumService.queryRecycleList(reqDTO));
    }
/**
   * B8移除专辑下文件
   * gen by moon at 11/14/2024, 1:20:31 PM
   */
    @PostMapping("/oms/dataassets/album/removeFileOfAlbum")
    @ApiOperation(value = "B8移除专辑下文件", response = OkrResult.class)
    public OkrResult<BffRemoveFileOfAlbumRespDto> removeFileOfAlbum(@RequestBody(required=false) @Validated BffRemoveFileOfAlbumReqDto reqDTO){
        return OkrResult.success(albumService.removeFileOfAlbum(reqDTO));
    }
/**
   * B8删除专辑下文件
   * gen by moon at 11/14/2024, 1:20:34 PM
   */
    @PostMapping("/oms/dataassets/album/deleteFileOfAlbum")
    @ApiOperation(value = "B8删除专辑下文件", response = OkrResult.class)
    public OkrResult<BffDeleteFileOfAlbumRespDto> deleteFileOfAlbum(@RequestBody(required=false) @Validated BffDeleteFileOfAlbumReqDto reqDTO){
        return OkrResult.success(albumService.deleteFileOfAlbum(reqDTO));
    }
/**
   * B8批量删专辑下文件-清空回收站
   * gen by moon at 11/14/2024, 1:20:37 PM
   */
    @PostMapping("/oms/dataassets/album/batchDeleteFileOfAlbum")
    @ApiOperation(value = "B8批量删专辑下文件-清空回收站", response = OkrResult.class)
    public OkrResult<BffBatchDeleteFileOfAlbumRespDto> batchDeleteFileOfAlbum(@RequestBody(required=false) @Validated BffBatchDeleteFileOfAlbumReqDto reqDTO){
        return OkrResult.success(albumService.batchDeleteFileOfAlbum(reqDTO));
    }
/**
   * B8复制专辑和专辑下文件
   * gen by moon at 11/14/2024, 1:20:40 PM
   */
    @PostMapping("/oms/dataassets/album/copyAlbum")
    @ApiOperation(value = "B8复制专辑和专辑下文件", response = OkrResult.class)
    public OkrResult<BffCopyAlbumRespDto> copyAlbum(@RequestBody(required=false) @Validated BffCopyAlbumReqDto reqDTO){
        return OkrResult.success(albumService.copyAlbum(reqDTO));
    }
/**
   * B2修改专辑存档操作
   * gen by moon at 11/15/2024, 4:56:52 PM
   */
    @PostMapping("/oms/dataassets/album/updateAlbumArchiveOper")
    @ApiOperation(value = "B2修改专辑存档操作", response = OkrResult.class)
    public OkrResult<BffUpdateAlbumArchiveOperRespDto> updateAlbumArchiveOper(@RequestBody(required=false) @Validated BffUpdateAlbumArchiveOperReqDto reqDTO){
        return OkrResult.success(albumService.updateAlbumArchiveOper(reqDTO));
    }
/**
   * B8新增专辑文件关系
   * gen by moon at 11/18/2024, 10:10:52 PM
   */
    @PostMapping("/oms/dataassets/album/loopAddAlbumFileRelation")
    @ApiOperation(value = "B8新增专辑文件关系", response = OkrResult.class)
    public OkrResult<BffLoopAddAlbumFileRelationRespDto> loopAddAlbumFileRelation(@RequestBody(required=false) @Validated BffLoopAddAlbumFileRelationReqDto reqDTO){
        return OkrResult.success(albumService.loopAddAlbumFileRelation(reqDTO));
    }
/**
   * B8移动文件到指定专辑
   * gen by moon at 3/30/2025, 3:39:39 PM
   */
    @PostMapping("/oms/dataassets/album/moveFilesToSpecAlbum")
    @ApiOperation(value = "B8移动文件到指定专辑", response = OkrResult.class)
    public OkrResult<BffMoveFilesToSpecAlbumRespDto> moveFilesToSpecAlbum(@RequestBody(required=false) @Validated BffMoveFilesToSpecAlbumReqDto reqDTO){
        return OkrResult.success(albumService.moveFilesToSpecAlbum(reqDTO));
    }
/**
   * B8复制文件到指定专辑
   * gen by moon at 3/30/2025, 3:39:46 PM
   */
    @PostMapping("/oms/dataassets/album/copyFilesToSpecAlbum")
    @ApiOperation(value = "B8复制文件到指定专辑", response = OkrResult.class)
    public OkrResult<BffCopyFilesToSpecAlbumRespDto> copyFilesToSpecAlbum(@RequestBody(required=false) @Validated BffCopyFilesToSpecAlbumReqDto reqDTO){
        return OkrResult.success(albumService.copyFilesToSpecAlbum(reqDTO));
    }
/**
   * B8批量移除专辑下文件
   * gen by moon at 5/24/2025, 2:37:56 PM
   */
    @PostMapping("/oms/dataassets/album/batchRemoveAlbumFileRelation")
    @ApiOperation(value = "B8批量移除专辑下文件", response = OkrResult.class)
    public OkrResult<BffBatchRemoveAlbumFileRelationRespDto> batchRemoveAlbumFileRelation(@RequestBody(required=false) @Validated BffBatchRemoveAlbumFileRelationReqDto reqDTO){
        return OkrResult.success(albumService.batchRemoveAlbumFileRelation(reqDTO));
    }
/**
   * B8批量存档专辑下文件
   * gen by moon at 5/24/2025, 8:03:17 PM
   */
    @PostMapping("/oms/dataassets/album/batchArchiveAlbumFileRelation")
    @ApiOperation(value = "B8批量存档专辑下文件", response = OkrResult.class)
    public OkrResult<BffBatchArchiveAlbumFileRelationRespDto> batchArchiveAlbumFileRelation(@RequestBody(required=false) @Validated BffBatchArchiveAlbumFileRelationReqDto reqDTO){
        return OkrResult.success(albumService.batchArchiveAlbumFileRelation(reqDTO));
    }
/**
   * B8执行丢回收站
   * gen by moon at 5/27/2025, 1:27:54 PM
   */
    @PostMapping("/oms/dataassets/album/implementRecycle")
    @ApiOperation(value = "B8执行丢回收站", response = OkrResult.class)
    public OkrResult<BffImplementRecycleRespDto> implementRecycle(@RequestBody(required=false) @Validated BffImplementRecycleReqDto reqDTO){
        return OkrResult.success(albumService.implementRecycle(reqDTO));
    }
}
